home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / pcb.h.z / pcb.h
C/C++ Source or Header  |  1992-04-03  |  4KB  |  114 lines

  1. #ifndef __SYS_PCB_H__
  2. #define __SYS_PCB_H__
  3.  
  4. /**************************************************************************
  5.  *                                      *
  6.  *          Copyright (C) 1990, Silicon Graphics, Inc.          *
  7.  *                                      *
  8.  *  These coded instructions, statements, and computer programs  contain  *
  9.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  10.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  11.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  12.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  13.  *                                      *
  14.  **************************************************************************/
  15. /*    Copyright (c) 1984 AT&T    */
  16. /*      All Rights Reserved      */
  17.  
  18. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  19. /*    The copyright notice above does not evidence any       */
  20. /*    actual or intended publication of such source code.    */
  21.  
  22. /*#ident    "@(#)kern-port:sys/pcb.h    10.1"*/
  23. #ident    "$Revision: 3.9 $"
  24.  
  25. /*
  26.  * MIPS process control block
  27.  */
  28.  
  29. /*
  30.  * pcb_regs indices
  31.  */
  32. #define    PCB_S0        0    /* callee saved regs.... */
  33. #define    PCB_S1        1
  34. #define    PCB_S2        2
  35. #define    PCB_S3        3
  36. #define    PCB_S4        4
  37. #define    PCB_S5        5
  38. #define    PCB_S6        6
  39. #define    PCB_S7        7
  40. #define    PCB_SP        8    /* stack pointer */
  41. #define    PCB_FP        9    /* frame pointer */
  42. #define    PCB_PC        10    /* program counter */
  43. #define    PCB_SR        11    /* C0 status register */
  44. #define    PCB_LIOMSK    12    /* IP6 local interrupt mask register */
  45. #define    NPCBREGS    13    /* number of regs saved at ctxt switch */
  46.  
  47. #ifdef _KERNEL
  48. /*
  49.  * jmp_buf offsets
  50.  */
  51. #define    JB_S0        0    /* callee saved regs.... */
  52. #define    JB_S1        1
  53. #define    JB_S2        2
  54. #define    JB_S3        3
  55. #define    JB_S4        4
  56. #define    JB_S5        5
  57. #define    JB_S6        6
  58. #define    JB_S7        7
  59. #define    JB_SP        8    /* stack pointer */
  60. #define    JB_FP        9    /* frame pointer */
  61. #define    JB_PC        10    /* program counter */
  62. #define    JB_SR        11    /* C0 status register */
  63. #define    JB_LIOMSK    12    /* IP6 local interrupt mask register */
  64. #define    NJBREGS        13
  65. #endif /* _KERNEL */
  66.  
  67. /*
  68.  * single step information
  69.  * used to hold instructions that have been replaced by break's when
  70.  * single stepping
  71.  */
  72. struct ssi {
  73.     int ssi_cnt;            /* number of bp's installed */
  74.     struct ssi_bp {
  75.         unsigned *bp_addr;    /* address of replaced instruction */
  76.         unsigned bp_inst;    /* replaced instruction */
  77.     } ssi_bp[2];
  78. };
  79.  
  80. typedef struct pcb
  81. {
  82.     /*
  83.      * General purpose registers saved at context switch time.
  84.      *
  85.      * NOTE: current switch assembler code assumes that
  86.      * pcb_regs is the first thing in the pcb.
  87.      */
  88.     int    pcb_regs[NPCBREGS];
  89.  
  90.     int    pcb_resched;    /* non-zero if time to resched */
  91.     /* These are use in branch delay instruction emulation */
  92.     int    pcb_bd_epc;    /* epc register */
  93.     int    pcb_bd_cause;    /* cause register */
  94.     int    pcb_bd_ra;    /* address to return to if doing bd emulation */
  95.     int    pcb_bd_instr;    /* the branch instr for the bd emulation */
  96.     /* This is use in fp instruction emulation */
  97.     int    pcb_softfp_pc;    /* resulting pc after fp emulation */
  98.     /*
  99.      * Space for the state of all the potential coprocessors. WASTEFUL!
  100.      */
  101.     double    pcb_align;    /* 8-byte align for R4K sdc1/ldc1 for fpregs */
  102.     int    pcb_fpregs[32];    /* floating point */
  103.     int    pcb_fpc_csr;    /* floating point control and status reg */
  104.     int    pcb_fpc_eir;    /* floating point exception instruction reg */
  105.     int    pcb_ownedfp;    /* has owned fp at one time */
  106.     /*int    pcb_c2regs[32];    /* TBD */
  107.     /*int    pcb_c3regs[32];    /* TBD */
  108.     int    pcb_sstep;    /* non-zero if single stepping */
  109.     struct    ssi pcb_ssi;    /* single step state info */
  110. } pcb_t;
  111.  
  112. #define PCB(x)        (u.u_pcb.x)
  113. #endif /* __SYS_PCB_H__ */
  114.